package com.tuanzi.loan.business.entity.system;

import com.tuanzi.loan.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.*;

/**
 * @author Ray 2017/09/21
 */
@Data
@Entity
@Table(name = "TB_LOAN_DATA_PERMISSION")
@EqualsAndHashCode(callSuper = true)
public class DataPermission extends BaseEntity {

    private static final long serialVersionUID = -7163972604954972532L;

    @Id
    @GeneratedValue(generator = "uuid2")
    @GenericGenerator(name = "uuid2", strategy = "org.hibernate.id.UUIDGenerator")
    private String id;

    @NotBlank
    @Length(max = 200)
    @Column(name = "CODE")
    private String code;

    @Length(max = 36)
    @Column(name = "PARENT_ID")
    private String parentId;

    @NotBlank
    @Length(max = 200)
    @Column(name = "name")
    private String name;

    @NotBlank
    @Length(max = 200)
    @Column(name = "FIELD")
    private String field;

    @NotBlank
    @Length(max = 200)
    @Column(name = "VALUE")
    private String value;

    @Transient
    private String icon;

}
